package SparkRDD.RDD算子.Transformations.聚合操作

import org.apache.spark.{SparkConf, SparkContext}
import org.junit.Test

class lookupTest {

  val conf = new SparkConf().setMaster("local[6]").setAppName("test")
  val sc   = new SparkContext(conf)

  @Test
  def test(): Unit ={

    val m = sc.parallelize(Seq(("a",1),("b",2),("b",3),("a",11)))

    m.lookup("a").foreach(println(_))
//    1
//    11
    m.lookup("b").foreach(println(_))
//    2
//    3
  }
}
